/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nms.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author mohamedemara
 */
@Entity
@Table(name = "OPERATION_DEF")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "OperationDef.findAll", query = "SELECT o FROM OperationDef o"),
    @NamedQuery(name = "OperationDef.findByOperationNo", query = "SELECT o FROM OperationDef o WHERE o.operationNo = :operationNo"),
    @NamedQuery(name = "OperationDef.findByOperationDescAr", query = "SELECT o FROM OperationDef o WHERE o.operationDescAr = :operationDescAr"),
    @NamedQuery(name = "OperationDef.findByOperationDescEn", query = "SELECT o FROM OperationDef o WHERE o.operationDescEn = :operationDescEn")})
public class OperationDef implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "operation_no")
    private Integer operationNo;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "operation_desc_ar")
    private String operationDescAr;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 30)
    @Column(name = "operation_desc_en")
    private String operationDescEn;

    public OperationDef() {
    }

    public OperationDef(Integer operationNo) {
        this.operationNo = operationNo;
    }

    public OperationDef(Integer operationNo, String operationDescAr, String operationDescEn) {
        this.operationNo = operationNo;
        this.operationDescAr = operationDescAr;
        this.operationDescEn = operationDescEn;
    }

    public Integer getOperationNo() {
        return operationNo;
    }

    public void setOperationNo(Integer operationNo) {
        this.operationNo = operationNo;
    }

    public String getOperationDescAr() {
        return operationDescAr;
    }

    public void setOperationDescAr(String operationDescAr) {
        this.operationDescAr = operationDescAr;
    }

    public String getOperationDescEn() {
        return operationDescEn;
    }

    public void setOperationDescEn(String operationDescEn) {
        this.operationDescEn = operationDescEn;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (operationNo != null ? operationNo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OperationDef)) {
            return false;
        }
        OperationDef other = (OperationDef) object;
        if ((this.operationNo == null && other.operationNo != null) || (this.operationNo != null && !this.operationNo.equals(other.operationNo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.nms.entities.OperationDef[ operationNo=" + operationNo + " ]";
    }
    
}
